Skip to content

feat: thread xp through Grid2DIrregular.grid_2d_via_deflection_grid_from - #414

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/point-source-chi-squared-variants
Jul 27, 2026
Merged

Jammy2211 merged 2 commits into
mainfrom
feature/point-source-chi-squared-variants

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds an explicit xp=np parameter to Grid2DIrregular.grid_2d_via_deflection_grid_from, propagated like the sibling methods (subtracted_from, distances_to_coordinate_from) already do. This was the known JAX-jit blocker for the PyAutoLens point-source source-plane fit path (FitPositionsSource and the new solved-centre variants), which calls this method under trace. Part of the point-source likelihood-variants series (PyAutoLabs/PyAutoLens#657, phase 2 of 5).

API Changes

Added an optional xp=np keyword to one public method — fully backwards compatible (default preserves current behaviour).
See full details below.

Test Plan

  • pytest test_autoarray/ (906 passed locally)
  • Downstream: pytest test_autolens/point/ on the paired PyAutoLens branch (85 passed locally)
Full API Changes (for automation & release notes)

Changed Signature

  • Grid2DIrregular.grid_2d_via_deflection_grid_from(deflection_grid) → grid_2d_via_deflection_grid_from(deflection_grid, xp=np) — optional, default unchanged.

Companion PRs: PyAutoGalaxy + PyAutoLens branches feature/point-source-chi-squared-variants. Merge this first.

Generated by the PyAutoLabs agent workflow.

Removes the known JAX-jit blocker for the PyAutoLens point-source
source-plane fit path (PyAutoLabs/PyAutoLens#657, phase 2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ubtraction

xp=None now defaults to self._xp (pre-existing behaviour preserved for
JAX-backed callers not passing xp); deflection_grid unwrapped via .array
so traced values never hit __array__/asarray (verified: the source-plane
vmap+jit regression now passes where it raised TracerArrayConversionError).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 616e8b4 into main Jul 27, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/point-source-chi-squared-variants branch July 27, 2026 21:13
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant